package VarParameter;

public class VarParameter01 {
    public static void main(String[] args) {
        int a = 10, b = 29, c = 39, d = 33;
        lfmMethods lfm = new lfmMethods();
        int ret = lfm.GetSum(a, b, c, d);
        System.out.println("和为" + ret);
    }
}
class lfmMethods {
    int GetSum(int... nums) {
        System.out.println("传过来的个数为" + nums.length);
        int res = 0;
        for (int num : nums) {
            res += num;
        }
        return res;
    }
}
